package com.Controller;

import com.Service.HeadImageService;
import com.pojo.HeadImage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.sql.SQLException;
import java.util.List;

@Controller
@RequestMapping("/load")
public class HeadImageController {
    @Autowired
    private HeadImageService headImageService;
    @GetMapping("/Image")
    @ResponseBody
    public List<HeadImage> loadHeadImage(@RequestParam String username) throws SQLException {
        return headImageService.loadHeadImage(username);
    }
    @PostMapping("/updateImage")
    @ResponseBody
    public void updateMyHeadImage(@RequestParam String username,@RequestParam String headImage) throws SQLException {
      headImageService.updateMyHeadImage(username,headImage);
    }
}
